<?php

namespace app\store\controller\user;

use app\store\controller\Controller;
use app\common\model\user\Receive as ResModel;
use app\store\model\user\UserLabel;
use app\store\model\UserAddress;

class Receive extends Controller{


    public function index()
    {
        $model = new ResModel;
        $list = $model->getList($this->request->param());
        return $this->fetch('index', compact('list'));
    }

    public function detail($id)
    {
        // 评价详情
        $model = new ResModel;
        $data = $model->detail($id);
        if($data['user_label_id']){
            $data['user_label_name']=UserLabel::where(['label_id'=>$data['user_label_id']])->value('name');
        } else {
            $data['user_label_name']='';
        }
        if (!$this->request->isAjax()) {
            return $this->fetch('detail', compact('data'));
        }

    }
}